<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php $this->load->view('head'); ?>
</head>

<body>
	<?php $this->load->view('header_admin.php'); ?>
	
	<!-- Content Area -->
	<div class="wrapper-world content">
		<div class="wrapper">
			<h1>Submit picture</h1>
			
			<?php echo form_open_multipart('gallery/upload', 'class="left-aligned" id="addImage"'); ?>
				<div class="one">
					<label for="BrowserHidden">Select a picture:</label>
					<div class="file-upload"> 
					    <input type="file" size="24" name="userfile" id="BrowserHidden" onchange="getElementById('FileField').value = getElementById('BrowserHidden').value;" />			 
					    <div id="BrowserVisible"><input type="text" id="FileField" /></div>
					</div>
					<div class="clr"></div>
				</div>
				<div class="one">
					<label for="imagetext">Text (100 symbols):</label>
					<div class="type-textarea"><textarea name="imagetext" id="imagetext"></textarea></div>
					<div class="clr"></div>
				</div>		
			</form>
		</div>
		
		<div class="wrapper-world add-btn">
			<div class="wrapper">
				<a href="javascript:jQuery('form#addImage').submit();" title="Add this job order">ADD</a>
				<div class="clr"></div>
			</div>
		</div>	
		
		<div class="wrapper">	
			<?php foreach ($images as $image): ?>
			<div class="one-picture">
				<div class="job-delete"><?php echo anchor('/gallery/delete/'.md5($image['image']), 'Delete', array('title' => 'Delete image')); ?></div>
				<img src="<?php echo site_url() . $image['image']; ?>" width="200" />
				<?php echo $image['text']; ?>
			</div>
			<?php endforeach; ?>
			<div class="clr"></div>
		</div>
	</div> <!-- end of wrapper-world and .content -->
	
	
		
	<div class="wrapper-world footer-top">
		<div class="wrapper"></div>	
	</div>
	
	<?php $this->load->view('footer'); ?>
</body>
</html>
